<template>
	<view class="contain cu-card"> 
		<view class="cu-item" v-for="(item,index) in dataList" @click="detail(index)">
			<view class="" style="padding: 16rpx;">
				<view class="cu-list">
					<text style="font-size: 18px;">{{item.Title||''}}</text>
				</view>
				<view class="cu-list flex">
					<view style="width: 60%;">
						<text class="text-gray ">投诉时间:</text>
						<text style="margin-left: 2px;">{{item.FeedbackDate||''}}</text>
					</view>
					<view style="flex: 1;">
						<text class="text-gray">回复状态:</text>
						<text style="margin-left: 2px;" :style="{'color':item.ReplyStatus=='0'?'red':'green'}" >{{status[item.ReplyStatus]||''}}</text>
					</view>
				</view>
			</view>
		</view>
		
		<view class="padding" style="position: fixed; bottom: 150px;width: 98%;left: calc(1%); z-index: 100;" >
			<button class="cu-btn block bg-green margin-tb-sm lg" style="box-shadow: 0 3px 2px #90A19A;"  @click="complainBtn">我要投诉</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				modeData:[
					{title:'我是title1',content:'投诉内容1',time:'2020/06/04 11:08',status:'未回复'},
					{title:'我是title2',content:'投诉内容2222222222222',time:'2020/06/04 11:08',status:'已回复'},
					{title:'我是title3',content:'投诉内容1',time:'2020/06/04 11:08',status:'未回复'},
					{title:'我是title4',content:'投诉内容2222222222222',time:'2020/06/04 11:08',status:'已回复'},
				],
				dataList:[],
				status:['未回复','已回复']
			}
		},
		mounted(){
			const session= uni.getStorageSync('session');
			
			this.getDetail(session.openid)
		},
		methods: {
			getDetail(id){
				this.$store.dispatch('uni/GetFeedbackInfoList',{
					openid:id
				}).then(res=>{
					this.dataList=res.Data
				})
			},
			complainBtn(){
				uni.navigateTo({
					url:'/pages/home/complain/complainAdd'
				})
			},
			detail(index){
				let id=this.dataList[index].FeedbackID
				uni.navigateTo({
					url:`/pages/home/complain/complainOperate?id=${id}`
				})
			}
		}
	}
</script>

<style>

</style>
